﻿<%@ Page Language="C#" MasterPageFile="~/Guest.Master" AutoEventWireup="true" CodeBehind="Guest_ChiTietSanPham.aspx.cs" Inherits="ppm_BaByShop.WebForm4" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        Trang chi tiết sản phẩm</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:ppm_BaByShopConnectionString1 %>" 
            DeleteCommand="DELETE FROM [SAN_PHAM] WHERE [ma_sp] = @original_ma_sp AND [ten_sp] = @original_ten_sp AND [ma_nsx] = @original_ma_nsx AND [ma_loai_sp] = @original_ma_loai_sp AND [gia_ban] = @original_gia_ban AND [sl_ton] = @original_sl_ton AND [sl_ban] = @original_sl_ban AND [luot_xem] = @original_luot_xem AND [ma_tt_sp] = @original_ma_tt_sp AND [mo_ta] = @original_mo_ta AND [hinh_anh] = @original_hinh_anh" 
            InsertCommand="INSERT INTO [SAN_PHAM] ([ma_sp], [ten_sp], [ma_nsx], [ma_loai_sp], [gia_ban], [sl_ton], [sl_ban], [luot_xem], [ma_tt_sp], [mo_ta], [hinh_anh]) VALUES (@ma_sp, @ten_sp, @ma_nsx, @ma_loai_sp, @gia_ban, @sl_ton, @sl_ban, @luot_xem, @ma_tt_sp, @mo_ta, @hinh_anh)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [SAN_PHAM]" 
            UpdateCommand="UPDATE [SAN_PHAM] SET [ten_sp] = @ten_sp, [ma_nsx] = @ma_nsx, [ma_loai_sp] = @ma_loai_sp, [gia_ban] = @gia_ban, [sl_ton] = @sl_ton, [sl_ban] = @sl_ban, [luot_xem] = @luot_xem, [ma_tt_sp] = @ma_tt_sp, [mo_ta] = @mo_ta, [hinh_anh] = @hinh_anh WHERE [ma_sp] = @original_ma_sp AND [ten_sp] = @original_ten_sp AND [ma_nsx] = @original_ma_nsx AND [ma_loai_sp] = @original_ma_loai_sp AND [gia_ban] = @original_gia_ban AND [sl_ton] = @original_sl_ton AND [sl_ban] = @original_sl_ban AND [luot_xem] = @original_luot_xem AND [ma_tt_sp] = @original_ma_tt_sp AND [mo_ta] = @original_mo_ta AND [hinh_anh] = @original_hinh_anh">
            <DeleteParameters>
                <asp:Parameter Name="original_ma_sp" Type="String" />
                <asp:Parameter Name="original_ten_sp" Type="String" />
                <asp:Parameter Name="original_ma_nsx" Type="String" />
                <asp:Parameter Name="original_ma_loai_sp" Type="String" />
                <asp:Parameter Name="original_gia_ban" Type="Int32" />
                <asp:Parameter Name="original_sl_ton" Type="Int32" />
                <asp:Parameter Name="original_sl_ban" Type="Int32" />
                <asp:Parameter Name="original_luot_xem" Type="Int32" />
                <asp:Parameter Name="original_ma_tt_sp" Type="Int32" />
                <asp:Parameter Name="original_mo_ta" Type="String" />
                <asp:Parameter Name="original_hinh_anh" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ten_sp" Type="String" />
                <asp:Parameter Name="ma_nsx" Type="String" />
                <asp:Parameter Name="ma_loai_sp" Type="String" />
                <asp:Parameter Name="gia_ban" Type="Int32" />
                <asp:Parameter Name="sl_ton" Type="Int32" />
                <asp:Parameter Name="sl_ban" Type="Int32" />
                <asp:Parameter Name="luot_xem" Type="Int32" />
                <asp:Parameter Name="ma_tt_sp" Type="Int32" />
                <asp:Parameter Name="mo_ta" Type="String" />
                <asp:Parameter Name="hinh_anh" Type="String" />
                <asp:Parameter Name="original_ma_sp" Type="String" />
                <asp:Parameter Name="original_ten_sp" Type="String" />
                <asp:Parameter Name="original_ma_nsx" Type="String" />
                <asp:Parameter Name="original_ma_loai_sp" Type="String" />
                <asp:Parameter Name="original_gia_ban" Type="Int32" />
                <asp:Parameter Name="original_sl_ton" Type="Int32" />
                <asp:Parameter Name="original_sl_ban" Type="Int32" />
                <asp:Parameter Name="original_luot_xem" Type="Int32" />
                <asp:Parameter Name="original_ma_tt_sp" Type="Int32" />
                <asp:Parameter Name="original_mo_ta" Type="String" />
                <asp:Parameter Name="original_hinh_anh" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ma_sp" Type="String" />
                <asp:Parameter Name="ten_sp" Type="String" />
                <asp:Parameter Name="ma_nsx" Type="String" />
                <asp:Parameter Name="ma_loai_sp" Type="String" />
                <asp:Parameter Name="gia_ban" Type="Int32" />
                <asp:Parameter Name="sl_ton" Type="Int32" />
                <asp:Parameter Name="sl_ban" Type="Int32" />
                <asp:Parameter Name="luot_xem" Type="Int32" />
                <asp:Parameter Name="ma_tt_sp" Type="Int32" />
                <asp:Parameter Name="mo_ta" Type="String" />
                <asp:Parameter Name="hinh_anh" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="ma_sp" DataSourceID="SqlDataSource1" 
            Height="50px" Width="122px">
            <Fields>
                <asp:BoundField DataField="ma_sp" HeaderText="ma_sp" ReadOnly="True" 
                    SortExpression="ma_sp" />
                <asp:BoundField DataField="ten_sp" HeaderText="ten_sp" 
                    SortExpression="ten_sp" />
                <asp:BoundField DataField="ma_nsx" HeaderText="ma_nsx" 
                    SortExpression="ma_nsx" />
                <asp:BoundField DataField="ma_loai_sp" HeaderText="ma_loai_sp" 
                    SortExpression="ma_loai_sp" />
                <asp:BoundField DataField="gia_ban" HeaderText="gia_ban" 
                    SortExpression="gia_ban" />
                <asp:BoundField DataField="sl_ton" HeaderText="sl_ton" 
                    SortExpression="sl_ton" />
                <asp:BoundField DataField="sl_ban" HeaderText="sl_ban" 
                    SortExpression="sl_ban" />
                <asp:BoundField DataField="luot_xem" HeaderText="luot_xem" 
                    SortExpression="luot_xem" />
                <asp:BoundField DataField="ma_tt_sp" HeaderText="ma_tt_sp" 
                    SortExpression="ma_tt_sp" />
                <asp:BoundField DataField="mo_ta" HeaderText="mo_ta" SortExpression="mo_ta" />
                <asp:BoundField DataField="hinh_anh" HeaderText="hinh_anh" 
                    SortExpression="hinh_anh" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" ShowSelectButton="True" />
            </Fields>
        </asp:DetailsView>
    </p>
</asp:Content>
